package com.acyouzi;

import java.util.Scanner;

public class Main{
  public static boolean[] getArr(){
    boolean[] arr = new boolean[10001];
    for(int i = 2; i <= 10000; i++){
      int j = 2;
      if(!arr[i]){
        while(i*j <= 10000){
          arr[i*j] = true;
          j++;
        }
      }
    }
    return arr;
  }
  public static boolean helper(int index){
    for(int i = 2; i <= index / 2; i++){
      if(index % i == 0) return false;
    }
    return true;
  }
  public static void main(String[] args){
    Scanner in = new Scanner(System.in);
    while(in.hasNext()){
      int len = in.nextInt();
      if ( len == 0 || len == 1 || len == 2){
        System.out.println(len);
        continue;
      }
      int index = 2;
      int tmp = 2;
      while(tmp < len){
        index ++;
        if(helper(index)) {
          tmp ++;
        }
      }
      System.out.println(index);
    }
  }
}